package com.service.impl;

import com.mapper.User;
import com.mapper.UserMapper;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User queryById(int id) {
        User user = userMapper.selectByPrimaryKey(id);
        return user;
    }

    @Override
    public void deleteById(int id) {
        userMapper.deleteByPrimaryKey(id);
    }
    @Override
    public List<User> queryAll() {
        return userMapper.selectAll();
    }
}
